package com.hugesoft.logic.module;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import com.hugesoft.logic.module.Police;
import com.hugesoft.logic.module.Bus;
import com.hugesoft.logic.module.Traffic;
import com.hugesoft.logic.module.DriverLicence;
import com.hugesoft.logic.module.Note;
import com.hugesoft.logic.module.Customer;
import com.hugesoft.logic.module.Order;

import com.hugesoft.logic.module.PoliceDao;
import com.hugesoft.logic.module.BusDao;
import com.hugesoft.logic.module.TrafficDao;
import com.hugesoft.logic.module.DriverLicenceDao;
import com.hugesoft.logic.module.NoteDao;
import com.hugesoft.logic.module.CustomerDao;
import com.hugesoft.logic.module.OrderDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig policeDaoConfig;
    private final DaoConfig busDaoConfig;
    private final DaoConfig trafficDaoConfig;
    private final DaoConfig driverLicenceDaoConfig;
    private final DaoConfig noteDaoConfig;
    private final DaoConfig customerDaoConfig;
    private final DaoConfig orderDaoConfig;

    private final PoliceDao policeDao;
    private final BusDao busDao;
    private final TrafficDao trafficDao;
    private final DriverLicenceDao driverLicenceDao;
    private final NoteDao noteDao;
    private final CustomerDao customerDao;
    private final OrderDao orderDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        policeDaoConfig = daoConfigMap.get(PoliceDao.class).clone();
        policeDaoConfig.initIdentityScope(type);

        busDaoConfig = daoConfigMap.get(BusDao.class).clone();
        busDaoConfig.initIdentityScope(type);

        trafficDaoConfig = daoConfigMap.get(TrafficDao.class).clone();
        trafficDaoConfig.initIdentityScope(type);

        driverLicenceDaoConfig = daoConfigMap.get(DriverLicenceDao.class).clone();
        driverLicenceDaoConfig.initIdentityScope(type);

        noteDaoConfig = daoConfigMap.get(NoteDao.class).clone();
        noteDaoConfig.initIdentityScope(type);

        customerDaoConfig = daoConfigMap.get(CustomerDao.class).clone();
        customerDaoConfig.initIdentityScope(type);

        orderDaoConfig = daoConfigMap.get(OrderDao.class).clone();
        orderDaoConfig.initIdentityScope(type);

        policeDao = new PoliceDao(policeDaoConfig, this);
        busDao = new BusDao(busDaoConfig, this);
        trafficDao = new TrafficDao(trafficDaoConfig, this);
        driverLicenceDao = new DriverLicenceDao(driverLicenceDaoConfig, this);
        noteDao = new NoteDao(noteDaoConfig, this);
        customerDao = new CustomerDao(customerDaoConfig, this);
        orderDao = new OrderDao(orderDaoConfig, this);

        registerDao(Police.class, policeDao);
        registerDao(Bus.class, busDao);
        registerDao(Traffic.class, trafficDao);
        registerDao(DriverLicence.class, driverLicenceDao);
        registerDao(Note.class, noteDao);
        registerDao(Customer.class, customerDao);
        registerDao(Order.class, orderDao);
    }
    
    public void clear() {
        policeDaoConfig.getIdentityScope().clear();
        busDaoConfig.getIdentityScope().clear();
        trafficDaoConfig.getIdentityScope().clear();
        driverLicenceDaoConfig.getIdentityScope().clear();
        noteDaoConfig.getIdentityScope().clear();
        customerDaoConfig.getIdentityScope().clear();
        orderDaoConfig.getIdentityScope().clear();
    }

    public PoliceDao getPoliceDao() {
        return policeDao;
    }

    public BusDao getBusDao() {
        return busDao;
    }

    public TrafficDao getTrafficDao() {
        return trafficDao;
    }

    public DriverLicenceDao getDriverLicenceDao() {
        return driverLicenceDao;
    }

    public NoteDao getNoteDao() {
        return noteDao;
    }

    public CustomerDao getCustomerDao() {
        return customerDao;
    }

    public OrderDao getOrderDao() {
        return orderDao;
    }

}
